package com.cskaoyan.market.controller;

import com.cskaoyan.market.service.WxGoodsService;
import com.cskaoyan.market.service.WxHomeService;
import com.cskaoyan.market.util.ResponseUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created with IntelliJ IDEA.
 *
 * @Auther:Han_Xiu_Long
 * @Date: 2024/05/21/19:30
 * @Description:
 */
@RestController
@RequestMapping("/wx/goods")
public class WxGoodsController {
    @Autowired
    WxGoodsService wxGoodsService;

    @GetMapping("/category")
    public Object category(Integer id) {
        return ResponseUtil.ok(wxGoodsService.category(id));
    }

    @GetMapping("/list")
    public Object list(Integer categoryId, Integer page, Integer limit) {
        return ResponseUtil.ok(wxGoodsService.list(categoryId, page, limit));
    }

    @GetMapping("count")
    public Object count() {
        return ResponseUtil.ok(wxGoodsService.count());
    }
}
